home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / pcw.zip / CLR_WND.C < prev    next >
C/C++ Source or Header  |  1991-12-21  |  2KB  |  38 lines

  1. /**********************************************************/
  2. /* File Id.                  Clr_Wnd.C                    */
  3. /* Date Written.             05/14/89.                    */
  4. /*                                                        */
  5. /*         (c) Copyright 1989, 1990 by Stan Milam         */
  6. /*                                                        */
  7. /* Comments:  Used to clear a window.  If action flag is  */
  8. /* non-zero the area inside the borders will be cleared   */
  9. /* otherwise the whole window (including borders) will be */
  10. /* cleared. The color specified when framing the window   */
  11. /* will be used.                                          */
  12. /**********************************************************/
  13.  
  14. #include "pcw.i"
  15. #include "pcwproto.h"
  16.  
  17. int clr_wnd(WNDPTR *wnd, int action) {
  18.  
  19.     int urow, ucol, lrow, lcol;                  /* Scratch Stuff */
  20.     int foreground, background;
  21.  
  22.     if (!wnd) return(0);
  23.     if (!chk_video_state(&urow,&ucol)) return(0);
  24.     re_order(wnd, NORMAL);                       /* Reorder the window */
  25.     urow = wnd->urow;                            /* Get rows and cols */
  26.     ucol = wnd->ucol;
  27.     lrow = wnd->lrow;
  28.     lcol = wnd->lcol;
  29.     set_cursor_pos(urow+1,ucol+1);
  30.     if (action) {                                /* If action non-zero */
  31.        urow++; ucol++;                           /* Clear inside of borders */
  32.        lrow--; lcol--;
  33.     }
  34.     background = (wnd->attr & 0xf0) >> 4;        /* Get the color attributes */
  35.     foreground = wnd->attr &0x0f;
  36.     return(qfill(urow, ucol, lrow, lcol, foreground, background, 32));
  37. }
  38.